#!/bin/bash
set -o nounset                              # Treat unset variables as an error
echo '
 set title "Network speed"
      set xlabel "Time(s)"
      set ylabel "Mb/s"
      set key off
      f(x) = mean_y
      fit f(x) "data/watt_8_nc_tcp_rands.parsed" u 1:3 via mean_y
      
      set terminal epslatex color colortext
      
    set output "watt_8_nc_tcp_rands.tex"
      set label 3 gprintf("Mean = %gMb/s", mean_y) at  60,8192
    
      plot "data/watt_8_nc_tcp_rands.parsed" using 1:3 with line title "Total","data/watt_8_nc_tcp_rands.parsed" using 1:9 with line title "tcprrr8nc5","data/watt_8_nc_tcp_rands.parsed" using 1:10 with line title "tcprrr8nc2","data/watt_8_nc_tcp_rands.parsed" using 1:11 with line title "tcprrr8nc0","data/watt_8_nc_tcp_rands.parsed" using 1:12 with line title "tcprrr8nc4","data/watt_8_nc_tcp_rands.parsed" using 1:13 with line title "tcprrr8nc7","data/watt_8_nc_tcp_rands.parsed" using 1:14 with line title "tcprrr8nc6","data/watt_8_nc_tcp_rands.parsed" using 1:15 with line title "tcprrr8nc3","data/watt_8_nc_tcp_rands.parsed" using 1:16 with line title "tcprrr8nc1","data/watt_8_nc_tcp_rands.parsed" using 1:17 with line title "tcprr8nc3","data/watt_8_nc_tcp_rands.parsed" using 1:18 with line title "tcprr8nc7","data/watt_8_nc_tcp_rands.parsed" using 1:19 with line title "tcprr8nc1","data/watt_8_nc_tcp_rands.parsed" using 1:20 with line title "tcprr8nc5","data/watt_8_nc_tcp_rands.parsed" using 1:21 with line title "tcprr8nc0","data/watt_8_nc_tcp_rands.parsed" using 1:22 with line title "tcprr8nc2","data/watt_8_nc_tcp_rands.parsed" using 1:23 with line title "tcprr8nc6","data/watt_8_nc_tcp_rands.parsed" using 1:24 with line title "tcprr8nc4"' |gnuplot -persist      
      
